package kbs.scm
{
    public class LambdaFunction extends Base
    {
        public function LambdaFunction(args:AList, body:AList, env:Env)
        {
            m_args = args;
            m_body = body;
            m_env = env;
        }

        public function getArguments():AList
        { return m_args; }
        public function getBody():AList
        { return m_body; }
        public function getEnvironment():Env
        { return m_env; }
        override public function pprint():String
        {
            var ret:String = "(lambda-function (";
            for (var i:int =0; i<m_args.length(); i++) {
                ret += (m_args.get(i) as Base).pprint();
                ret += " ";
            }
            ret += ") ";
            for (i=0; i<m_body.length(); i++) {
                ret += (m_body.get(i) as Base).pprint();
            }
            ret += ")";
            return ret;
        }

        private var m_args:AList;
        private var m_body:AList;
        private var m_env:Env;
    }
}
